Skip to content

feat: add Kiro CLI adapter - #115

Open
mvanhorn wants to merge 2 commits into
codeaholicguy:mainfrom
mvanhorn:feat/109-kiro-cli-adapter
Open

feat: add Kiro CLI adapter#115
mvanhorn wants to merge 2 commits into
codeaholicguy:mainfrom
mvanhorn:feat/109-kiro-cli-adapter

Conversation

@mvanhorn

Copy link
Copy Markdown
Contributor

Summary

Adds a Kiro CLI adapter to agent-manager so AI DevKit can detect, list, start, and route messages to Kiro CLI sessions, the same way it already does for Claude Code, Codex, Copilot, Gemini CLI, OpenCode, and Pi.

Why this matters

Closes the maintainer-declared work item in #109 ("Support Kiro CLI in agent-manager"). Kiro was the one requested coding agent not yet wired into the adapter layer, so agent list, agent start --type kiro, agent sessions --type kiro, and the channel bridge had no way to reach it.

Changes

  • New KiroAdapter (packages/agent-manager/src/adapters/KiroAdapter.ts), mirroring the existing PiAdapter: process detection, PID-to-session tracker matching, defensive JSONL session parsing, conversation/listSessions support, and idle/waiting status. Reads sessions from ~/.kiro/cli/sessions and gracefully returns empty results when that directory is absent.
  • Extended the AgentType union with 'kiro' and exported KiroAdapter from adapters/index.ts and agent-manager/src/index.ts.
  • Registered kiro in the AGENTS registry (launch command kiro-cli; process matcher accepts the kiro-cli or kiro basename) and added it to StartableAgentType.
  • Registered new KiroAdapter() in both AgentManager factories (cli/src/commands/agent.ts and cli/src/services/channel/channel-runner.ts), added the Kiro display label, extended the --type help text, and added 'kiro' to VALID_AGENT_TYPES.
  • Updated the README agent-support table to list Kiro CLI.

Testing

  • New KiroAdapter.test.ts (type identity, kiro-cli/kiro process matching with no false positives, session detection) — agent-manager suite: 435 passed.
  • Updated sessions.test.ts, agent.test.ts, channel.test.ts, and StartAgentPane.test.ts for the new type/registration/cycle order — cli suite: 808 passed.
  • nx run-many -t build -p agent-manager (swc + tsc typecheck) and nx run-many -t lint -p agent-manager cli both clean.

Fixes #109

AI was used for assistance.

@codeaholicguy

Copy link
Copy Markdown
Owner

Hi, thank you for your contribution, but this PR doesn't seem to resolve the integration. I'm not sure that it was tested or not. There is no such ~/.kiro/cli/sessions when Kiro is running.

There are things that can give you hints to solve the integration:

  • All Kiro sessions are stored under ~/.kiro/sessions/cli/
  • When a session is running, there will be a lock file in the session folder such as `~/.kiro/sessions/cli/.lock; this file will contain PID info; we can use this to map with process. If the session is ended, the lock file will gone.
  • ~/.kiro/sessions/cli/<session-id>.json contains all metadata of the session, such as cwd, etc
  • ~/.kiro/sessions/cli/<session-id>.jsonl contains the conversation history, including user message, assistant message, tool use, etc

Please make sure you test all the workflows, from agent list, agent send, agent open, and all the features work well with the new agent type (kiro) in the agent console.

Thank you.

The adapter looked under ~/.kiro/cli/sessions, which does not exist. Per
review, Kiro stores CLI sessions under ~/.kiro/sessions/cli/ and marks a
running session with a lock file in that directory.

Discover active sessions from those locks and resolve each one to its sibling
metadata and transcript, instead of scanning a path that is never populated.
@mvanhorn

mvanhorn commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

You were right, it was not tested against a running Kiro and the path was wrong.

Now reads ~/.kiro/sessions/cli/, discovers running sessions from the lock file in that directory, and resolves each lock to its sibling metadata and transcript, rather than scanning ~/.kiro/cli/sessions which never exists.

431 tests pass in agent-manager, typecheck and lint clean. I still have not been able to run it against a live Kiro session, so if you can spot-check the lock and transcript shapes against a real one that would help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Kiro CLI in agent-manager

2 participants